package com.meisupic.copyright.domain.po;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "copyright_vip_member")
public class VipMemberPo {

  private Long id;
  private Long memberCategoryId;
  private String memberCategoryName;
  private String orderNo;
  private Integer leftAmount;
  private Integer total;
  private BigDecimal price;
  private Long userId;
  private Date expiryDate;
  private Date createDate;

  @Id
  @Column(name = "id", nullable = false)
  @GeneratedValue
  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  @Basic
  @Column(name = "member_category_id", nullable = false)
  public Long getMemberCategoryId() {
    return memberCategoryId;
  }

  public void setMemberCategoryId(Long memberCategoryId) {
    this.memberCategoryId = memberCategoryId;
  }

  @Basic
  @Column(name = "member_category_name", nullable = false, length = 50)
  public String getMemberCategoryName() {
    return memberCategoryName;
  }

  public void setMemberCategoryName(String memberCategoryName) {
    this.memberCategoryName = memberCategoryName;
  }

  @Basic
  @Column(name = "order_no", nullable = false, length = 50)
  public String getOrderNo() {
    return orderNo;
  }

  public void setOrderNo(String orderNo) {
    this.orderNo = orderNo;
  }

  @Basic
  @Column(name = "left_amount", nullable = false)
  public Integer getLeftAmount() {
    return leftAmount;
  }

  public void setLeftAmount(Integer leftAmount) {
    this.leftAmount = leftAmount;
  }

  @Basic
  @Column(name = "total", nullable = true)
  public Integer getTotal() {
    return total;
  }

  public void setTotal(Integer total) {
    this.total = total;
  }

  @Basic
  @Column(name = "price", nullable = false)
  public BigDecimal getPrice() {
    return price;
  }

  public void setPrice(BigDecimal price) {
    this.price = price;
  }

  @Basic
  @Column(name = "user_id", nullable = true)
  public Long getUserId() {
    return userId;
  }

  public void setUserId(Long userId) {
    this.userId = userId;
  }

  @Basic
  @Column(name = "expiry_date", nullable = true)
  public Date getExpiryDate() {
    return expiryDate;
  }

  public void setExpiryDate(Date expiryDate) {
    this.expiryDate = expiryDate;
  }

  @Basic
  @Column(name = "create_date", nullable = true)
  public Date getCreateDate() {
    return createDate;
  }

  public void setCreateDate(Date createDate) {
    this.createDate = createDate;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    VipMemberPo that = (VipMemberPo) o;
    return Objects.equals(id, that.id) &&
        Objects.equals(memberCategoryId, that.memberCategoryId) &&
        Objects.equals(memberCategoryName, that.memberCategoryName) &&
        Objects.equals(orderNo, that.orderNo) &&
        Objects.equals(leftAmount, that.leftAmount) &&
        Objects.equals(total, that.total) &&
        Objects.equals(userId, that.userId) &&
        Objects.equals(expiryDate, that.expiryDate) &&
        Objects.equals(createDate, that.createDate);
  }

  @Override
  public int hashCode() {

    return Objects
        .hash(id, memberCategoryId, memberCategoryName, orderNo, leftAmount, total, userId,
            expiryDate, createDate);
  }

}
